package com.codechuan.didi_web.service.impl;

import com.codechuan.didi_web.entity.SysUserToken;
import com.codechuan.didi_web.mapper.SysUserTokenMapper;
import com.codechuan.didi_web.service.SysUserTokenService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysUserTokenServiceImpl implements SysUserTokenService {
    @Resource
    private SysUserTokenMapper sysUserTokenMapper;

    /**
     * @param keyNumber 账户
     * @return 返回ticket
     * @Deprecated 通过账户查询所有ticket
     */
    @Override
    public SysUserToken selectTokenByAccount(String keyNumber) {
        return sysUserTokenMapper.selectByPrimaryKey(keyNumber);
    }

    /**
     * @param keyNumber 账户
     * @return 返回ticket
     * @Deprecated 通过账户查询主号ticket
     */
    @Override
    public String selectMainTokenByAccount(String keyNumber) {
        return sysUserTokenMapper.selectMainTokenByAccount(keyNumber);
    }

    /**
     * @param account 账户
     * @return 返回ticket
     * @Deprecated 通过账户查询小号ticket集合
     */
    @Override
    public List<String> selectMiniTokenListByAccount(String account) {
        return sysUserTokenMapper.selectMiniTokenListByAccount(account);
    }
}
